package ywxt.tool.stool.common.mapper

import ywxt.tool.stool.entity.PoemEntity
import ywxt.tool.stool.model.PoemModel

inline fun PoemEntity.toPoemModel(block: PoemModel.() -> Unit): PoemModel {
    val model = toPoemModel()
    block(model)
    return model
}
fun PoemEntity.toPoemModel():PoemModel {
    requireNotNull(id)
    return PoemModel(id,content,title,poet.toPoetModel(),position,dynasty,season)
}